/*
 *  Copyright (c) 2010-2023
 */
package net.siufung.market.base.uuid.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import java.io.Serializable;
import net.siufung.core.model.enums.DeletedEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import net.siufung.market.base.uuid.mapper.entity.SysUuid;
import net.siufung.market.base.uuid.service.ISysUuidService;
import net.siufung.market.base.uuid.mapper.ISysUuidMapper;
import net.siufung.mybatis.base.BaseServiceImpl;

import lombok.extern.slf4j.Slf4j;
import lombok.AllArgsConstructor;

/**
 * 流水号表 数据服务实现
 * @author 陈建峰
 * @since 2023-10-09 22:16:17
 * @version 1.0.0
 */
@Slf4j
@AllArgsConstructor
@Service("sysUuidService")
@Transactional(rollbackFor = Exception.class)
public class SysUuidServiceImpl extends BaseServiceImpl<ISysUuidMapper, SysUuid> implements ISysUuidService {

    @Override
    public boolean updateStatusById(Serializable id, DeletedEnum deletedEnum) {
        return super.update(new LambdaUpdateWrapper<SysUuid>().eq(SysUuid::getId, id)
            .set(SysUuid::getDeleted, deletedEnum.getValue()));
    }
}